Skip to content

Conversation

chetnadev
Copy link
Contributor

@chetnadev chetnadev commented Oct 12, 2025

This "after" business rule automatically creates a Problem record when a particular Configuration Item (CI) has had 5 or more incidents in the last 24 hours, and no open Problem already exists for that CI.
This helps in proactive problem management, aiming to address recurring issues.
Here’s the working of the code explained:

  • Check if CI is present in the current Incident (current.cmdb_ci).
  • Count incidents created in the last 24 hours for the same CI using GlideAggregate.

If 5 or more incidents are found for that CI:

  • Query the Problem table to check if an open Problem (not closed) already exists for that CI.
  • If no open Problem exists, create a new Problem record with: The same CI, A predefined short description And set its state to New (1).
  • Log a message indicating that a Problem has been created.
    This automates Problem creation for frequent incidents on the same CI.

@rohi-v rohi-v assigned rohi-v and unassigned rohi-v Oct 12, 2025
@ivan-betev ivan-betev self-assigned this Oct 12, 2025
@ivan-betev
Copy link
Contributor

Thanks for your contribution, you are almost there.

Please invest some time into a proper README formatting otherwise it's not user-friendly, doesn't explain what type of business rule and the conditions user should user.

In your code you are using gr as a variable name, which is dangerous in a global scope.

Please fix this and let me know.

@chetnadev
Copy link
Contributor Author

Hi @ivan-betev . I've done the suggested changes in both files, please check and let me know.

@ivan-betev
Copy link
Contributor

Thanks for your contribution @chetnadev, I'll approve it, however, please avoid using unclear variable names (ck ???) and try to follow the best practice.

@ivan-betev ivan-betev merged commit 036d425 into ServiceNowDevProgram:main Oct 12, 2025
1 check passed
@chetnadev chetnadev deleted the probhack branch October 12, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants